import { sendRequest } from "@/utils/http"
import type { aiOptimization, resumeDetail } from "@/types/resume"
import type { resumeListInfo } from "@/types/resumeList"
export const getResumeListAPI = (userId:number) => {
  return sendRequest<resumeDetail[]>({
    url: '/server-interview/resume/getResumeList',
    method: 'GET',
    data: {userId:userId}
  })

}
//保存简历基本信息，触发情况：简历信息的保存信息按钮里面
export const saveResumeAPI=(resumeDetail:resumeDetail) => {
  return sendRequest<string>({
    url: '/server-interview/resume/saveResume',
    method: 'PUT',
    data: resumeDetail
  }) 
}

export const getInternshipExperienceCreateAPI =(resumeListInfo:resumeListInfo)=>{
  return sendRequest<aiOptimization>({
    url:'/server-ai/resume/getInternshipExperience',
    method: 'GET',
    data: resumeListInfo
  })
}
export const getcampusExperienceCreateAPI = (resumeListInfo: resumeListInfo)=>{
  return sendRequest<aiOptimization>({
    url:'/server-ai/resume/getCampusExperience',
    method: 'GET',
    data: resumeListInfo
  })
}
export const getselfEvaluationCreateAPI = (resumeListInfo: resumeListInfo)=>{
  return sendRequest<aiOptimization>({
    url:'/server-ai/resume/getSelfEvaluation',
    method: 'GET',
    data: resumeListInfo
  })
}

//获取简历基本信息 参数userid 返回resumeDetail get  //简历基本信息的onload里面触发
export const getResumeBasicDetailsAPI=(userId:number)=>{

  return sendRequest<resumeDetail>({
    url: '/server-interview/resume/getResumeBasicDetails',
    method: 'GET',
    data: {userId:userId}
  })
}
//保存 简历具体信息 参数resumeDetail 返回string Post  //简历具体信息的保存信息按钮里面
export const postResumeSpecificInfoAPI = (resumeListInfo: resumeListInfo)=>{
  return sendRequest<string>({
    url: '/server-interview/resume/postResumeSpecificInfo',
    method: 'POST',
    data: resumeListInfo
  })
}

//获取 简历具体信息  参数id 返回resumeDetail get  //先做请求
export const getResumeSpecificInfoAPI=(id:number)=>{
  return sendRequest<resumeDetail>({
    url: '/server-user/resume/getResumeSpecificInfo',
    method: 'GET',
   data: {id:id}
  })
}